var base_url = "http://baich-day.com/";
//update pass
$('#update_button').click(function(){
    var _old = $('#old_pass').val();
    var new_pass = $('#new_pass').val();
    var new_pass1 = $('#new_pass1').val();
    if(_old==null || new_pass==null || new_pass1==null)
    {
        var u= "<div class='alert alert-danger' role='alert' style='width:20%; margin-left:10px; margin-top:10px;'>Fill All Fields</div>";
        document.getElementById("con").innerHTML=u;
    }
    else
    {
        if(new_pass==new_pass1)
        {
             $.post(base_url+"members/update_pass",
                    {
                        old : _old,
                        pass : new_pass,
                    })
                 .error(
                    function(){
                        console.log("Error!");
                    })
                .success(
                        function(data){
                         //insert into db 
                             $( "#con" ).html( data );
                    });
        }
        else
        {
            var u= "<div class='alert alert-danger' role='alert' style='width:45%; margin-left:10px; margin-top:10px;'>New Password Doesn't Match</div>";
            document.getElementById("con").innerHTML=u;
        }
    }
});



//notes download ++

$('#dwn').click(function(){
    var val = $('#div').html();
    var notes_id = $('#notes_id').val();
    val++;
    $.post(base_url+"members/download_increment",
           {
            value : val,
            id : notes_id,
           })
            .error(
                    function(){
                        console.log("Error!");
                    })
            .success(
                    function(data){
                     //insert into db 
                         $( "#div" ).html(data);
                });
});